From 05e5154038b4614f4b7d6f43eb7e8b741a014608 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 31 Jan 2007 17:58:00 +0000 Subject: [PATCH] [XEN] Fix perfc after 13756:56377f5ce588 64 bit guest handles can no longer be passed as parameters to functions. Extract such parameters into a regular guest handle first. Signed-off-by: Ian Campbell --- xen/common/perfc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/common/perfc.c b/xen/common/perfc.c index bbff5d7b5c..d5bcd9b2e1 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -136,8 +136,8 @@ static xen_sysctl_perfc_desc_t perfc_d[NR_PERFCTRS]; static xen_sysctl_perfc_val_t *perfc_vals; static int perfc_nbr_vals; static int perfc_init = 0; -static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, - XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val) +static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc, + XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val) { unsigned int i, j; unsigned int v = 0; @@ -217,20 +217,29 @@ static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, int perfc_control(xen_sysctl_perfc_op_t *pc) { static DEFINE_SPINLOCK(lock); + XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc; + XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val; int rc; + /* + * 64 bit guest handles cannot be passed as parameters to + * functions so cast to a regular guest handle. + */ + desc = guest_handle_cast(pc->desc, xen_sysctl_perfc_desc_t); + val = guest_handle_cast(pc->val, xen_sysctl_perfc_val_t); + spin_lock(&lock); switch ( pc->cmd ) { case XEN_SYSCTL_PERFCOP_reset: - perfc_copy_info(pc->desc, pc->val); + perfc_copy_info(desc, val); perfc_reset(0); rc = 0; break; case XEN_SYSCTL_PERFCOP_query: - perfc_copy_info(pc->desc, pc->val); + perfc_copy_info(desc, val); rc = 0; break; -- 2.30.2